package org.theqcp.wow.model.mechanics;

public enum Race {

	//alliance
	HUMAN("human"),
	GNOME("gnome"),
	DWARF("dwarf"),
	DRAENEI("draenei"),
	NIGHTELF("nightelf"),
	
	//horde
	ORC("orc"),
	TROLL("troll"),
	TAUREN("tauren"),
	UNDEAD("undead"),
	BLOODELF("bloodelf")
	
	;
	
	private String name;
	
	private Race(String name) {
		this.name = name;
	}
	
	public String getName() {
		return this.name;
	}
	
	
	public static Race getRaceFromName(String name) {
		
		//adjust name
		name = name.trim().toLowerCase().replace(" ", "");
		
		//return name
		for(Race r : Race.values()) {
			if(r.name.equals(name)) {
				return r;
			}
		}
		
		//return human as default
		return Race.HUMAN;
	}
}
